<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:oraxsl="http://www.oracle.com/XSL/Transform/java"
                xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
                xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
                xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
                xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
                xmlns:oracle-xsl-mapper="http://www.oracle.com/xsl/mapper/schemas"
                xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:tns="http://platform.integration.oracle/blocks/adapter/fw/metadata/EmailSender"
                xmlns:ns0="saibot.airport/services/flightupdatenotification"
                exclude-result-prefixes="xsd xsi oracle-xsl-mapper xsl ns0 tns oraxsl xp20 xref mhdr oraext dvm socket"
                xmlns:reference="saibot.airport/data/reference" xmlns:common="saibot.airport/data/common"
                xmlns:flight="saibot.airport/data/flight">
  <oracle-xsl-mapper:schema>
    <!--SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY.-->
    <oracle-xsl-mapper:mapSources>
      <oracle-xsl-mapper:source type="XSD">
        <oracle-xsl-mapper:schema location="../Schemas/FlightUpdateNotificationService.xsd"/>
        <oracle-xsl-mapper:rootElement name="sendFlightUpdateNotificationRequestMessage"
                                       namespace="saibot.airport/services/flightupdatenotification"/>
      </oracle-xsl-mapper:source>
    </oracle-xsl-mapper:mapSources>
    <oracle-xsl-mapper:mapTargets>
      <oracle-xsl-mapper:target type="XSD">
        <oracle-xsl-mapper:schema location="../Schemas/EmailSender.xsd"/>
        <oracle-xsl-mapper:rootElement name="message"
                                       namespace="http://platform.integration.oracle/blocks/adapter/fw/metadata/EmailSender"/>
      </oracle-xsl-mapper:target>
    </oracle-xsl-mapper:mapTargets>
    <!--GENERATED BY ORACLE XSL MAPPER 12.1.3.0.0(XSLT Build 140119.0846.5239) AT [SUN MAR 02 09:50:24 CET 2014].-->
  </oracle-xsl-mapper:schema>
  <!--User Editing allowed BELOW this line - DO NOT DELETE THIS LINE-->
  <xsl:template match="/">
    <tns:message>
      <tns:payload>
        Dear <xsl:value-of select="/ns0:sendFlightUpdateNotificationRequestMessage/ns0:CommunicationMetadata/ns0:Salutation"/>&nbsp;
        <xsl:value-of select="/ns0:sendFlightUpdateNotificationRequestMessage/ns0:CommunicationMetadata/ns0:ToAddress"/>
        This is a flight status update from Saibot Airport regarding flight: <xsl:value-of select="concat(/ns0:sendFlightUpdateNotificationRequestMessage/ns0:Carrier,/ns0:sendFlightUpdateNotificationRequestMessage/ns0:FlightNumber)"/>
        
        The current status for this flight:
        Date: <xsl:value-of select="xp20:format-dateTime(/ns0:sendFlightUpdateNotificationRequestMessage/ns0:FlightStatus/flight:TimePlanningUnit/reference:startDate,'[D01]-[M01]-[Y0001]')"/>
        Time: <xsl:value-of select="xp20:format-dateTime(/ns0:sendFlightUpdateNotificationRequestMessage/ns0:FlightStatus/flight:TimePlanningUnit/reference:startDate,'[H01]:[m01]')"/>
        
        
        Status:   <xsl:value-of select="/ns0:sendFlightUpdateNotificationRequestMessage/ns0:FlightStatus/flight:Status"/>
        Action:   <xsl:value-of select="/ns0:sendFlightUpdateNotificationRequestMessage/ns0:FlightStatus/flight:Action"/>
        
        Check In Details:
        =================        
        Terminal: <xsl:value-of select="/ns0:sendFlightUpdateNotificationRequestMessage/ns0:FlightStatus/flight:GateLocation/reference:Terminal"/>
        Pier:     <xsl:value-of select="/ns0:sendFlightUpdateNotificationRequestMessage/ns0:FlightStatus/flight:GateLocation/reference:Pier"/>
        Gate:     <xsl:value-of select="/ns0:sendFlightUpdateNotificationRequestMessage/ns0:FlightStatus/flight:GateLocation/reference:Gate"/>
        Checkin Counter:  <xsl:value-of select="/ns0:sendFlightUpdateNotificationRequestMessage/ns0:FlightStatus/flight:CheckinCounter"/>
        
        
        
      </tns:payload>
    </tns:message>
  </xsl:template>
</xsl:stylesheet>
